package com.fjrz.bbxwj.mode.api

import com.fjrz.bbxwj.entity.ReportTypeResponse
import com.module.lemlin.mode.SubscribeListener
import com.module.lemlin.rxhttp.HttpServiceData
import com.module.lemlin.rxhttp.subscribe
import io.reactivex.rxjava3.disposables.Disposable
import rxhttp.RxHttp


/**
 * 举报类型列表
 * */
fun reportTypeList(
    listener: SubscribeListener<ReportTypeResponse>
): Disposable = subscribe(
    RxHttp.get("/api/report/type_list")
        .asClass(ReportTypeResponse::class.java), listener
)

/**
 * 举报提交
 * */
fun reportSubmit(
    videoId: String,
    typeId: String,
    content: String,
    images: String,
    listener: SubscribeListener<HttpServiceData>
): Disposable = subscribe(
    RxHttp.postForm("/api/report/submit")
        .add("video_id", videoId)
        .add("type_id", typeId)
        .add("content", content)
        .add("images", images)
        .asClass(HttpServiceData::class.java), listener
)